'''
Created on Nov 20, 2009

@author: mkiyer
'''

import veggie.alignment.sam as samtools
import veggie.db.refdb as refdb
import os
import sys
import logging

if __name__ == '__main__':
    logging.basicConfig(level=logging.DEBUG)
    insamfile = sys.argv[1]
    outsamfile = sys.argv[2]
    headerfile = sys.argv[3]

    bamfile = samtools.process_tophat_sam(insamfile, outsamfile, headerfile, 
                                          rmdup=True, tmp_path='.', keep_tmp=False)
    
#    import veggie.genome.chrom as genome    
#    references = genome.HG18.chrom_sizes.keys()
#    seqdict = os.path.join(refdb.get_bowtie_indexes_path(), 
#                           'hg18_illumina', 
#                           'hg18_illumina.dict')    
#    bamfile = samtools.prepare_bam(insamfile, 
#                                   outsamfile,
#                                   unique_only=True,
#                                   template=seqdict,
#                                   references=references,
#                                   tmp_path=os.getcwd(),
#                                   keep_tmp=False)